function [fzero] = expan_frame_pitch_autolag(frame, fs,lag,eth)

% 
%   


len = length(lag);
autcor = expan_autolag(frame,lag);


fator = 40;
x = linspace(0,len,len);
xi = linspace(0,len,fator*len);
autocorr = interp1(x,autcor,xi,'cubic');

maxx = max(autocorr);

autocorrn = autocorr./maxx;

pico = expan_peaks(autocorrn,0.6);


npicos = length(pico);

s = 0;
for i=2:npicos
    s = s + (pico(i) - pico(i-1));
end    

Tzero = s/(npicos-1);


fzero = fs*fator / Tzero;


if eth == 1
   figure
   plot(x,autcor,xi,autocorr)
end
